//
//  PK-ios
//
//  Created by peikua on 15/9/15.
//  Copyright (c) 2015年 peikua. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIView (Category)
//把View加在Window上
- (void) addToWindow;

//view中所有view只保留一个选中
+(void)allBtnDeSelected:(UIView *)fatherView onlyOneSelected:(UIButton *)selectedBtn;

//view中所有view只保留一个选中,用tag值
+(void)allBtnDeSelected:(UIView *)fatherView onlyOneSelectedWithTag:(NSInteger )selectedBtnTag;

//所有按钮都不选中
+(void)allBtnDeSelected:(UIView *)fatherView;

@end

@interface UIView (Screenshot)

//View截图
- (UIImage*) screenshot;

//ScrollView截图 contentOffset
- (UIImage*) screenshotForScrollViewWithContentOffset:(CGPoint)contentOffset;

//View按Rect截图
- (UIImage*) screenshotInFrame:(CGRect)frame;

//整个view转成图片
- (UIImage*) convertToImage;


/**
 上下分割线

 @param color <#color description#>
 @param frame <#frame description#>
 @return <#return value description#>
 */
+(instancetype)createTopBottomLineViewWithBacgroundColor:(UIColor *)color Frame:(CGRect)frame;

/**
 仅添加上线

 @param color <#color description#>
 @return <#return value description#>
 */
+(instancetype)createTopLineViewWithBacgroundColor:(UIColor *)color Frame:(CGRect)frame;


/**
 添加下线
 */
@property(nonatomic,assign)BOOL addBottomLineView;

/**
 上分割线
 */
@property(nonatomic,assign)BOOL addTopLineView;
/**
 添加不顶头的分割线

 @param color <#color description#>
 @return <#return value description#>
 */
+(instancetype)separateBottomLineWithColor:(UIColor *)color;

@end

@interface UIView (Animation)

//左右抖动动画
- (void) shakeAnimation;

//旋转180度
- (void) trans180DegreeAnimation;

//为1的分割线
+(instancetype)lineViewWithTop:(BOOL)top Position:(CGFloat)position Color:(UIColor *)color;


@end

